# py3把urllib2分割成urllib.request和urllib.parse

import urllib.request

response = urllib.request.urlopen('http://www.baidu.com')
html = response.read()          # 返回响应体的字节流
print(html.decode('utf8'))
print(response.code)            # 状态码